﻿using System.Web.Mvc;
using System.Diagnostics;

namespace CashFlow.Web.Controllers
{
	//[HandleError]
	public class CashFlowController : Controller
	{
		//
		// GET: /CashFlow/
		public ActionResult List()
		{
			return View();
		}

		//
		// GET: /CashFlow/
		public ActionResult Refresh(string month)
		{
			var model = FakeData.CashFlowProvider.GetCashFlow(20);
			return View(model);
		}

		public JsonResult GetCashFlow(string month, string nav)
		{
			Trace.WriteLine(string.Format("{0} {1}", month, nav));
			var cashFLow = FakeData.CashFlowProvider.GetCashFlow(10);
			cashFLow.MonthValue = (int.Parse(cashFLow.MonthValue) + 1).ToString();
			return this.Json(cashFLow, JsonRequestBehavior.AllowGet);
		}

	}
}
